#!/bin/bash

product_tree=$1
database=$2
user=$3
pw=$4

echo "product_tree: " .$product_tree
echo "database: " . $database
echo "user: " .$user
echo "pw: " .$pw

print_usage()
{
   echo "Usage: /data/tools/bin/perl $0 <location of product_tree> <location of tracking_sheet> <database> <user> <pw>"
   echo "Import XLS tracking sheet data into DB."
}

if [ "x$pw" == "x" ]; then
   echo "[ERROR] All arguments not available."
   print_usage
   exit 1
fi

for i in `cat mldc_tracking_sheet_list`
do
  tracking_sheet="/tmp/mldc_tracking_sheet/"$i
  echo $tracking_sheet
  /data/tools/bin/perl comm.pl $product_tree $tracking_sheet $database $user $pw
done
